<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <title>选择收货地址</title>
    <link rel="stylesheet" type="text/css" href="/style/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="/style/css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="/style/css/xshop.css"/>
    <script src="/style/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/style/js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/style/js/xShop.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="outwrap">
    <!--top-->
    
    <div class="meinner-adr">
        <div class="adr-box">
            <ul class="adr-list">
                <?php
                if ($this->data) {
                    foreach ($this->data as $r) {
                        ?>
                        <li data-addressid="<?= $r['id']; ?>">
                            <div class="title clearfix"><h4><?= stripslashes($r['realname']); ?></h4>
                                <span><?=substr($r['mobile'],0,3).'****'.substr($r['mobile'],7,4)?></span></div>
                            <p><?= $r['province_name'] . $r['city_name'] . $r['county_name'] . $r['address']; ?></p>
                             <?php if(!empty($r['idnum'])){?>
                                         <p><?= substr_replace($r['idnum'],'***********',3,11)?></p>
                               <?php }?>
                            <div class="line"></div>
                            <div class="opr-bar">
                              <a href="/user/edit_user_address?cartIds=<?=$_GET['cartid']?>&id=<?= $r['id'] ?>&pid=<?= $_GET['id']?>"><i class="ico-bj"></i>编辑</a>
                                  
                          </div>
                        </li>
                        <?
                    }
                }
                ?>

            </ul>
        </div>
    </div>

    <!--底部导航-->
    <div class="btn-tjadr">
    <?php 
    /* if($_GET['id']>0){
       $url 
        
       } */
    ?>
        <a href="/cart/address_add?cartid=<?= $_GET['cartid']; ?>&back=addresslist&pid=<?= $_GET['id']; ?>">添加收货地址</a>
    </div>

</div>

<script type="text/javascript">
   var id = <?=$_GET['id']>0?$_GET['id']:0;?>;
    $(document).ready(function (e) {
        $(".adr-list li").on("click", function () {
            if(id>0){
           	 window.location.href = '/onermb/checkout?id=<?=$_GET['id'];?>&addressid=' + $(this).attr("data-addressid");
                }else{
               	 window.location.href = '/cart/checkout?cartid=<?=$_GET['cartid'];?>&addressid=' + $(this).attr("data-addressid");
                }
           
        });
    });

</script>
</body>
</html>
